package page.Beans;

import java.sql.SQLException;

import basicTypes.RAClient;

public class userHist {
	private userHistBean user;
	private String userStr;
	
	public userHistBean getUser() {
		return user;
	}
	public void setUser(userHistBean user) {
		this.user = user;
	}
	public String getUserStr() {
		return userStr;
	}
	public void setUserStr(String userStr) {
		this.userStr = userStr;
	}
	
	public String userHistadm(loginBean x){
		RAClient novo = null;
		loginBean aux = x;
		
		try{
			novo = x.getBd().db_getClient(x.getUser(), userStr).get(0);
			aux.setUser(novo);
			user = new userHistBean(x);
		}
		catch(SQLException e){
			System.out.println(e.getMessage());
			return "fail";
		}
		catch(IndexOutOfBoundsException a){
			return "fail";
		}
		
		return "suc";
		
	}
	
}
